from django.db import models

from column.models import Column
from user.models import UserProfile


# Create your models here.
class Videos(models.Model):
    vid = models.CharField(max_length=9, primary_key=True)
    file_path = models.CharField(max_length=200, null=False, blank=False)
    duration = models.FloatField(null=False, blank=False)
    title = models.CharField(max_length=50, null=False, blank=False)
    cover_path = models.CharField(max_length=200, null=False, blank=False)
    tags = models.CharField(max_length=100,null=False, blank=False)
    type = models.CharField(max_length=50, null=False, blank=False)
    description = models.TextField(null=False, blank=False)
    update_time = models.DateTimeField(auto_now=True)
    mup = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='mup')
    status = models.BooleanField(default=True)
    column = models.ForeignKey(Column, on_delete=models.CASCADE, related_name='column', blank=True, null=True)
